

import 'package:flutter/material.dart';

class SwipeList extends StatelessWidget{

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'adfadsf',
      home: new Scaffold(
        appBar: new AppBar(
          title: new Text('aaa'),
        ),
        body: new SLT(new List<String>.generate(20, (index)=>'item ${index + 1}'))
      ),
    );
  }

}

class SLT extends StatelessWidget{


  SLT(this.items);

  final List<String> items;

  @override
  Widget build(BuildContext context) {
    return new ListView.builder(itemBuilder: (context, index){
      final item = items[index];
      return new Dismissible(
          key: new Key(item),
          onDismissed: (direction){
            items.removeAt(index);
            Scaffold.of(context).showSnackBar(new SnackBar(content: new Text('$item dismissed')));
          },
          background: new Container(color: Colors.red,),
          child: new ListTile(
            title: new Text('$item'),
          ));
    },
    itemCount: items.length,);
  }
}